package com.cblue.qimokao.service.impl;

import com.cblue.qimokao.entity.Order;
import com.cblue.qimokao.mapper.OrderMapper;
import com.cblue.qimokao.service.FilmService;
import com.cblue.qimokao.service.OrderService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

@Service
public class OrderServiceImpl implements OrderService {

    @Resource
    private OrderMapper orderMapper;

    @Resource
    private FilmService doctorService;

    @Override
    public void add(Order order) {
        orderMapper.insert(order);
        doctorService.sub(order.getDoctorid());
    }
}
